<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>1.事件绑定</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <h2>欢迎来到{{school}}</h2>
      <button v-on:click="showTel">点我查看学校电话</button>
      <button @click="showTel">点我查看学校电话</button>
    </div>

    <script type="text/javascript">
      const vm = new Vue({
        el:'#demo',
        data:{
          school:'尚硅谷',
          tel:'010-56253825'
        },
        methods:{
          showTel(event){
            console.log(this)
            console.log(event.clientX)
            alert(this.tel)
          }
        }
      })
      console.log(vm)

    </script>
  </body>
</html>